package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TbDeviceStatusMapper;
import com.ruoyi.system.domain.TbDeviceStatus;
import com.ruoyi.system.service.ITbDeviceStatusService;

/**
 * 设备运行状态Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-23
 */
@Service
public class TbDeviceStatusServiceImpl implements ITbDeviceStatusService 
{
    @Autowired
    private TbDeviceStatusMapper tbDeviceStatusMapper;

    /**
     * 查询设备运行状态
     * 
     * @param id 设备运行状态主键
     * @return 设备运行状态
     */
    @Override
    public TbDeviceStatus selectTbDeviceStatusById(Long id)
    {
        return tbDeviceStatusMapper.selectTbDeviceStatusById(id);
    }

    /**
     * 查询设备运行状态列表
     * 
     * @param tbDeviceStatus 设备运行状态
     * @return 设备运行状态
     */
    @Override
    public List<TbDeviceStatus> selectTbDeviceStatusList(TbDeviceStatus tbDeviceStatus)
    {
        return tbDeviceStatusMapper.selectTbDeviceStatusList(tbDeviceStatus);
    }

    /**
     * 新增设备运行状态
     * 
     * @param tbDeviceStatus 设备运行状态
     * @return 结果
     */
    @Override
    public int insertTbDeviceStatus(TbDeviceStatus tbDeviceStatus)
    {
        tbDeviceStatus.setCreateTime(DateUtils.getNowDate());
        return tbDeviceStatusMapper.insertTbDeviceStatus(tbDeviceStatus);
    }

    /**
     * 修改设备运行状态
     * 
     * @param tbDeviceStatus 设备运行状态
     * @return 结果
     */
    @Override
    public int updateTbDeviceStatus(TbDeviceStatus tbDeviceStatus)
    {
        tbDeviceStatus.setUpdateTime(DateUtils.getNowDate());
        return tbDeviceStatusMapper.updateTbDeviceStatus(tbDeviceStatus);
    }

    /**
     * 批量删除设备运行状态
     * 
     * @param ids 需要删除的设备运行状态主键
     * @return 结果
     */
    @Override
    public int deleteTbDeviceStatusByIds(Long[] ids)
    {
        return tbDeviceStatusMapper.deleteTbDeviceStatusByIds(ids);
    }

    /**
     * 删除设备运行状态信息
     * 
     * @param id 设备运行状态主键
     * @return 结果
     */
    @Override
    public int deleteTbDeviceStatusById(Long id)
    {
        return tbDeviceStatusMapper.deleteTbDeviceStatusById(id);
    }
}
